package model

import (
	"context"
	"demo/domain/model/vo"
	"time"
)

type VisitStatisticsRepository interface {
	Save(ctx context.Context, entity *VisitStatistics) error

	Update(ctx context.Context, entity *VisitStatistics) error

	// SelectByUniqueKey 根据唯一键查询统计记录
	SelectByUniqueKey(ctx context.Context, statisticsDate time.Time, compressCode string,
		shortUrlDigest string, longUrlDigest string) (*VisitStatistics, error)

	StatisticsByCondition(ctx context.Context, query *vo.ShortUrlStatisticsCondition) ([]vo.ShortUrlStatisticsResult, int64, error)
}
